### Copyright (C) 2010 Desmond Carter
###
### This file is part of Ar.
###
### Ar is free software: you can redistribute it and/or modify it under the
### terms of the GNU General Public License as published by the Free Software
### Foundation, either version 3 of the License, or (at your option) any later
### version.
###
### Ar is distributed in the hope that it will be useful, but WITHOUT ANY
### WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
### FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
### details.
###
### You should have received a copy of the GNU General Public License along
### with Ar. If not, see <http://www.gnu.org/licenses/>.

## This file contains the class that generic pieces will inherit from. Note that
## it is currently almost entirely unimplemented.


from ar.locals import *
import ar, ar.drawtools


class Piece(object): #largely unimplemented because drawing isn't done
    '''This is the class basic pieces will inherit from.'''

    # parent is supposed to be an ArBoard, controller is an integer, image is a
    # Surface, and coords is an iterable. Doesn't really matter right now.
    def __init__(self, parent, controller=0, image=None, coords=0):
        self.parent = parent
        self.controller = controller
        self.image = image
        self.coords = coords

    def is_contained(self, other):
        return other.contains(self.coords)
